import fetch from '../utils/fetch'
import config from '../utils/config'
import { querystring } from 'vux'

var LoginService = {
  login: function (loginCode, loginPwd, code) {
    var mypostdata = {
      LoginCode: loginCode,
      LoginPassword: loginPwd,
      code: code
    }
    var url = config.API_SERVER + '/WXApi.ajax?action=Login'
    return fetch({
      url: url,
      method: 'POST',
      data: querystring.stringify(mypostdata),
      headers: {'Content-Type': 'application/x-www-form-urlencoded'}
    })
  }
}

export default LoginService
